if (ANTLR_INCLUDE_DIR AND ANTLR_LIBRARIES)
  # in cache already
  set(ANTLR_FOUND TRUE)
else (ANTLR_INCLUDE_DIR AND ANTLR_LIBRARIES)
  message(STATUS "Searching for ANTLR")
  find_path(ANTLR_INCLUDE_DIR antlr3.h)
  find_library(ANTLR_LIBRARIES NAMES antlr3 antlr3c libantlr3 libantlr3c)
  find_file(ANTLR_JAR antlr-3.jar PATHS ${EUROPA_ROOT}/ext/lib)

  if (ANTLR_INCLUDE_DIR AND ANTLR_LIBRARIES AND ANTLR_JAR)
    set(ANTLR_FOUND TRUE)
    # TODO version check is missing
  endif (ANTLR_INCLUDE_DIR AND ANTLR_LIBRARIES AND ANTLR_JAR)
  if (ANTLR_FOUND)
    if (NOT ANTLR_FIND_QUIETLY)
      message(STATUS "Found Antlr3 C runtime: ${ANTLR_LIBRARIES}")
    endif (NOT ANTLR_FIND_QUIETLY)
  else (ANTLR_FOUND)
    if (ANTLR_FIND_REQUIRED)
      if (NOT ANTLR_INCLUDE_DIR)
	message(FATAL_ERROR "Could NOT find Antlr3 header files")
      endif (NOT ANTLR_INCLUDE_DIR)
      if (NOT ANTLR_LIBRARIES)
	message(FATAL_ERROR "Could NOT find Antlr3 C runtime library")
      endif (NOT ANTLR_LIBRARIES)
      if (NOT ANTLR_JAR)
	message(FATAL_ERROR "Could NOT find Antlr3 jar file")
      endif (NOT ANTLR_JAR)
    endif (ANTLR_FIND_REQUIRED)
  endif (ANTLR_FOUND)
  mark_as_advanced(ANTLR_INCLUDE_DIR ANTLR_LIBRARIES)
endif (ANTLR_INCLUDE_DIR AND ANTLR_LIBRARIES)